// router/index.js
import Vue from 'vue';
import Router from 'vue-router';
import QRCodeGenerator from '@/components/QRCodeGenerator/QRCodeGenerator.vue'
import scanResult from '@/components/ScanResult/ScanResult.vue'

Vue.use(Router);

const routes = [
  {
    path: '/scanResult',
    name: 'Home',
    component: scanResult
  },
  { 
    path: '/QRCodeGenerator',
    name: 'about',
    component: QRCodeGenerator    
  },
  {
  path: '/',
  redirect:'/QRCodeGenerator'
}
];

const router = new Router({
  mode: 'history', // 使用 HTML5 History 模式，需要后端配置支持或使用hash模式
  routes // short for `routes: routes`
});

export default router;
